home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / IFC_112 / netscape / application / Target.java < prev    next >
Encoding:
Text File  |  1999-05-28  |  1.2 KB  |  30 lines  |  [TEXT/CWIE]

  1. // Target.java
  2. // By Ned Etcode
  3. // Copyright 1995, 1996, 1997 Netscape Communications Corp.  All rights reserved.
  4.  
  5. package netscape.application;
  6.  
  7. import netscape.util.*;
  8.  
  9. /** Interface enabling a generalized object request framework. Objects
  10.   * need to ask other objects to perform certain actions. It may not be
  11.   * feasible, however, for the sender to know the exact message to send to the
  12.   * target object at compile time. With the Target interface, the sender does
  13.   * not have to know anything about the target except that it implements the
  14.   * Target interface. The string <b>command</b> describes the action that the
  15.   * target should perform, with the arbitrary datum <b>data</b>. For example,
  16.   * when pressed, a Button needs to ask some object to perform a specific
  17.   * action. Rather than subclass Button to connect it to a specific method in a
  18.   * specific class, Button sends its messages to a Target instance, passing a
  19.   * string command (set as appropriate) and itself as the object.
  20.   */
  21.  
  22.  
  23. public interface Target {
  24.     /** Tells the target to perform the command <b>command</b>, using datum
  25.       * <b>data</b>.
  26.       */
  27.     public void performCommand(String command, Object data);
  28. }
  29.  
  30.